package com.dg.cuckoo.admin.service.impl;

import com.dg.cuckoo.admin.dto.other.FileDto;
import com.dg.cuckoo.admin.repository.FileRepository;
import com.dg.cuckoo.admin.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class FileServiceimpl implements FileService {

    @Autowired
    private FileRepository repository;

    @Override
    public List<String> byByMark(String mark) {
        List<FileDto> byByMark = repository.findByByMark(mark);
        List<String> list=new ArrayList<>();
        for(FileDto f:byByMark){
            list.add(f.getFileUrl());
        }
        return list;
    }

}
